﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using blackhouse.WebNemo.Business.Groups;

namespace blackhouse.NemoBlog.Business {
    public class NemoBlogTag : GroupRecord {

        #region Fields

        internal const string GROUP_TAGS = "BLOG_TAGS";

        #endregion

        #region Properties

        public int TagId { get { return this.RecordId; } }
        public string Name { get { return this.GetString("tagName"); } }
        public string Title { get { return this.GetString("title"); } }
        public string TagUrl { get { return this.GetString("url"); } set { this.SetValue("url", value); } }

        private Guid tagGuid = Guid.Empty;
        private bool tagGuidParsed = false;

        public Guid TagGuid {
            get {
                if (!tagGuidParsed) {
                    tagGuidParsed = true;
                    Guid.TryParse(this.GetString("guid"), out this.tagGuid);
                }
                return this.tagGuid;
            }
            set {
                this.tagGuid = value;
                this.tagGuidParsed = true;
                this.SetValue("guid", this.tagGuid.ToString());
            }
        }


        #endregion

        #region Constructors

        public NemoBlogTag(int tagId) : base(GROUP_TAGS, tagId) { }

        public NemoBlogTag() : base() { }

        #endregion

        #region Methods
        #endregion

    }
}
